#include <iostream>
using namespace std;
double power(int i, int n);

int main(void)
{
	int value = 0;
	int i;
	char ch;
	cout << "Enter an 8 bit bin number\n";

	for (i = 7; i >= 0; i--)
	{
		cin >> ch;
		if (ch == '1')
			value += int(power(2, i));
	}
	cout << "The Demcial Value is" << value;
	return 0;
}

double power(int i, int n)
{
	int val = 1;
	while (n--)
	{
		val = val * i;

	}
	return val;
}

